package com.yuanfeng.business.controller;

import com.yuanfeng.business.dto.NewAgreementStatusUpdatedDTO;
import com.yuanfeng.business.dto.UserTokenBeanDTO;
import com.yuanfeng.commoms.util.ResponseResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName ShopAgreementController
 * @Description 店铺协议
 * @Author cf
 * @Date 2023/6/26 9:32
 * @Version 1.0
 */
@RestController
@RequestMapping("/shop/agreement")
public class ShopAgreementController extends BaseController{


    /**
     * 校验店铺是否有新的协议要签
     *
     * @param param
     * @return
     */
    @PostMapping("/check/haveAgreement")
    public ResponseResult checkIsHaveAgreement(@RequestBody UserTokenBeanDTO param) {
        return shopAgreementService.checkIsHaveAgreement(param);
    }


    /**
     * 更新最新店铺协议
     *
     * @param param
     *
     */
    @PostMapping("/status/update")
    public ResponseResult updateNewAgreementStatus(@RequestBody NewAgreementStatusUpdatedDTO param) {
        ResponseResult result=shopAgreementService.updateNewAgreementStatus(param);
        return result;
    }

}
